package com.lsh.payment.core.model.payenum;

import java.util.HashMap;
import java.util.Map;

/**
 * 退款状态
 * @author peter
 */
public enum RefundTaskType {
    /**
     *
     */
    REFUND_START(10, "发起退款"),
    REFUND_QUERY(20, "核实退款结果"),
    REFUND_NOTIFY(30,"通知业务方退款结果");

    private int value;
    private String name;

    RefundTaskType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static RefundTaskType getPayStatus(int status) {
        for (RefundTaskType it : RefundTaskType.values()) {
            if (it.getValue() == status) {
                return it;
            }
        }
        return null;
    }

    private static Map<Integer, String> RefundTaskTypeMap = new HashMap<>(RefundTaskType.values().length * 2);

    static {
        for (RefundTaskType payStatus : RefundTaskType.values()) {
            RefundTaskTypeMap.put(payStatus.getValue(), payStatus.getName());
        }
    }

    public static Map<Integer, String> getRefundTaskTypeMap() {
        return RefundTaskTypeMap;
    }
}
